<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <base href="<?php echo $system['siteRoot'];?>" />
    <script type="text/javascript">root='<?php echo $system['root'];?>';</script>
    <title>发布文章</title>
    <link rel="stylesheet" href="plugin/awesome/font-awesome.min.css"/>
    <link rel="stylesheet" href="plugin/reset.css"/>
    <link rel="stylesheet" href="style/index.css"/>
    <link rel="stylesheet" href="style/article.css"/>
    <link rel="stylesheet" href="style/article-edit.css"/>
    <script src="plugin/jquery-1.11.2.min.js"></script>
    <script src="script/index.js"></script>
    <script>
        ueditorController='<?php e_page("ueditor","index");?>';
    </script>
    <script src="plugin/ueditor/ueditor.config.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugin/ueditor/ueditor.all.js" type="text/javascript" charset="utf-8"> </script>
    <script>
        $(document).ready(function(){
            $(".editor").each(function(){
                var ue = UE.getEditor($(this).attr("id"));
                ue.ready(function() {
                    var html = ue.getContent();
                    ue.execCommand('pasteplain');
                });
            });
        })
    </script>
</head>
<body>
<div class="container">
    <header>
        <div class="banner">
            <a href="<?php e_page("home","index"); ?>"><img class="logo" src="style/image/login-logo.png" alt=""></a>
            <?php import_part("custom.home","loginAndSearch"); ?>
        </div>
    </header>
    <div class="main-container">
        <div class="wrapper">
            <div class="nav">
                <a href="<?php e_action("add",""); ?>" class="select">发布文章</a>
                <a href="<?php e_action("article",""); ?>">文章管理</a>
            </div>
            <div class="article-box">
                <div class="user-information">
                    <?php import_part("custom.dash","userInfo");?>
                </div>
                <div class="article-manage">
                    <div class="article-manage-title">
                        <h3>个人主页/<a>文章管理</a></h3>
                    </div>
                    <div class="article-edit-box">
                        <form action="<?php e_action("addSubmit");?>" method="post" enctype="multipart/form-data">
                            <p class="title-input">
                            <label for="title-input" class="name-mark">文章标题</label>
                            <input type="text" name="title" id="title-input" placeholder="请填写文章标题">
                            </p>
                            <p>
                            <label for="menu-input" class="name-mark">所属分类</label>
                            <select name="menu_id" id="menu-input">
                            <?php foreach($r['menu'] as $i){ ?>
                                <optgroup label="<?=$i['name']?>">
                                <?php foreach($i['children'] as $j){ ?>
                                    <option value="<?=$j['id']?>"><?=$j['name']?></option>
                                <?php } ?>
                                </optgroup>
                            <?php } ?>
                            </select>
                            </p>
                            <p>
                            <label for="pic-input" class="name-mark">文章缩略图</label>
                            <input type="file" name="pic" id="pic-input" placeholder="请填写文章标题">
                            </p>
                            <p>
                            <label for="time-input" class="name-mark">发布时间</label>
                            <input type="date" name="publish_time" id="time-input" placeholder="">
                            </p>
                            <label for="" class="name-mark atcon">文章内容</label>
                            <script id="contentInput" name="content" class="editor" type="text/plain"></script>
                            <input type="submit" class="confirm-post" value="确认发布"/>
                            注：一旦发布，您将无法进行修改，将由管理员审核后发布。
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php import_tpl("fragment/footer.php"); ?>
</div>

</body>
</html>